using System.Collections.Generic;
using UnityEngine;

namespace MagicVoxelParse
{
    public class TVoxelData
    {
        public Vector3Int size;

        /// <summary>
        /// [{x, y, z, colorIndex}...]
        /// </summary>
        public List<VoxelStruct> voxel;

        /// <summary>
        /// 调色板
        /// [{r, g, b, a}...]
        /// </summary>
        public List<PaletteStruct> palette;

        /// <summary>
        /// NOTE:暂时不知道干嘛用的
        /// </summary>
        public readonly List<AnimStruct> anim;

        public TVoxelData()
        {
            size = Vector3Int.zero;
            voxel = new List<VoxelStruct>(0);
            palette = new List<PaletteStruct>(0);
            anim = new List<AnimStruct>(){new AnimStruct
            {
                size = Vector3Int.zero,
                voxel = new List<VoxelStruct>(0)
            }};
        }
    }

    public struct AnimStruct
    {
        public Vector3Int size;
        
        public List<VoxelStruct> voxel;
    }

    public struct VoxelStruct
    {
        public int x;
        public int y;
        public int z;
        public int colorIndex;
    }

    public struct PaletteStruct
    {
        public int r;
        public int g;
        public int b;
        public int a;
    }
}